package com.luxk.db.tx;

import com.luxk.db.common.ImpactException;

public interface Transaction {
	
	enum IsolationLevel {
		READ_UNCOMMITTED,
		READ_COMMITTED,
		SERIALIZABLE
	}

	public void setIsolationLevel(IsolationLevel islvl) throws ImpactException;
	public void apply(Change change) throws ImpactException;
	public void setSavePoint(String savepointName) throws ImpactException;
	public void commit() throws ImpactException;
	public void rollback() throws ImpactException;
	public void rollback(String savepointName) throws ImpactException;
	
	public interface Change {
		public void applyDo() throws ImpactException;
		public void applyUndo() throws ImpactException;
	}

}
